/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import DAO.LoginDAO;
import DAO.TimeDAO;
import model.Login;
import model.Time;

import static org.junit.Assert.*;
import org.junit.Test;

/**
 *
 * @author Alex
 */
public class CadastroDeJogadores {

    public CadastroDeJogadores() {
    }

    @Test
    public void cadastrarVariosTimes() {
        TimeDAO timeDAO = new TimeDAO();
        LoginDAO loginDAO = new LoginDAO();
        
        
        for (int h = 1; h<= 36; h++){
            Login login = new Login();
            
            login.setUsuario("teste"+h);
            login.setSenha(String.valueOf(h));
            login.setStatus(1);
            
            loginDAO.criar(login);
        }
        
        
        
        
       for (int i = 1; i<= 18; i++){
         
            
            Time time = new Time();
            time.setNome_time("time" + i);
            time.setCidade_time("cidade" + i);
            time.setNome_responsavel("responsável" + i);
            time.setCpf_responsavel("111" + i);
            time.setEmail_responsavel("alex" + i);
            time.setTelefone_responsavel("111" + i);
            time.setComentario("nada");
            time.setCategoria("A");
            try {
                time.setLogin(loginDAO.buscarLoginByCodigo(i));
            } catch (Exception e) {

            }
            timeDAO.criar(time);
            
        }
        

        for (int i = 1; i <= 18; i++) {

            

        }
        for (int i = 19; i <= 36; i++) {

            Time time = new Time();
            time.setNome_time("time" + i);
            time.setCidade_time("cidade" + i);
            time.setNome_responsavel("responsável" + i);
            time.setCpf_responsavel("111" + i);
            time.setEmail_responsavel("alex" + i);
            time.setTelefone_responsavel("111" + i);
            time.setComentario("nada");
            time.setCategoria("B");
            try {
                time.setLogin(loginDAO.buscarLoginByCodigo(i));
            } catch (Exception e) {

            }
            timeDAO.criar(time);

        }

    }
}
